#ifndef _SCALER_H_
#define _SCALER_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "lv_drv_conf.h"
#include "lvgl/src/lv_hal/lv_hal.h"

void yuv420_2_rgb565(int width, int height, const unsigned char *src, unsigned short *dst, unsigned semi);

unsigned rgb565_scale(int32_t src_width,
                   int32_t src_height,
                   int32_t dst_width,
                   int32_t dst_height,
                   uint8_t *src_buf,
                   uint8_t *dst_buf);

unsigned rgb888_2_rgb565_scale(int32_t src_width,
                   int32_t src_height,
                   int32_t dst_width,
                   int32_t dst_height,
                   uint8_t *src_buf,
                   uint8_t *dst_buf);

unsigned rgba8888_2_rgb565_scale(int32_t src_width,
                   int32_t src_height,
                   int32_t dst_width,
                   int32_t dst_height,
                   uint8_t *src_buf,
                   uint8_t *dst_buf);

unsigned yuv420_scale(int32_t src_width,
                   int32_t src_height,
                   int32_t dst_width,
                   int32_t dst_height,
                   uint8_t *src_buf,
                   uint8_t *dst_buf,
                   uint8_t semi);
lv_color_t* fb_rotation(lv_area_t * area, lv_color_t *fb, int degree);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
